home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / EXAMPLES / IDRAW / SLSPLINE.H < prev    next >
C/C++ Source or Header  |  1980-01-05  |  3KB  |  82 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. // $Header: slsplines.h,v 1.8 89/10/09 14:49:44 linton Exp $
  24. // declares classes BSplineSelection and ClosedBSplineSelection.
  25.  
  26. #ifndef slsplines_h
  27. #define slsplines_h
  28.  
  29. #include "selection.h"
  30.  
  31. // A BSplineSelection draws an open B-spline with a filled interior.
  32.  
  33. class BSplineSelection : public NPtSelection {
  34. public:
  35.  
  36.     BSplineSelection(Coord*, Coord*, int, Graphic* = nil);
  37.     BSplineSelection(istream&, State*);
  38.  
  39.     Graphic* Copy();
  40.     int GetOriginal(const Coord*&, const Coord*&);
  41.  
  42. protected:
  43.  
  44.     void Init(Coord*, Coord*, int);
  45.     RubberVertex* CreateRubberVertex(Coord*, Coord*, int, int);
  46.     Selection* CreateReshapedCopy(Coord*, Coord*, int);
  47.  
  48.     void uncacheChildren();
  49.     void getExtent(float&, float&, float&, float&, float&, Graphic*);
  50.     boolean contains(PointObj&, Graphic*);
  51.     boolean intersects(BoxObj&, Graphic*);
  52.     void draw(Canvas*, Graphic*);
  53.     void drawClipped(Canvas*, Coord, Coord, Coord, Coord, Graphic*);
  54.  
  55.     Graphic* ifillbspline;    // fills an open B-spline
  56.     Graphic* bspline;        // draws an open B-spline
  57.     Coord lx0, ly0, lx1, ly1;    // stores endpoints of left arrowhead
  58.     Coord rx0, ry0, rx1, ry1;    // stores endpoints of right arrowhead
  59.  
  60. };
  61.  
  62. // A ClosedBSplineSelection draws a closed B-spline with a filled
  63. // interior.
  64.  
  65. class ClosedBSplineSelection : public NPtSelection {
  66. public:
  67.  
  68.     ClosedBSplineSelection(Coord*, Coord*, int, Graphic* = nil);
  69.     ClosedBSplineSelection(istream&, State*);
  70.  
  71.     Graphic* Copy();
  72.     int GetOriginal(const Coord*&, const Coord*&);
  73.  
  74. protected:
  75.  
  76.     RubberVertex* CreateRubberVertex(Coord*, Coord*, int, int);
  77.     Selection* CreateReshapedCopy(Coord*, Coord*, int);
  78.  
  79. };
  80.  
  81. #endif
  82.